<?php
namespace App\Api\Transformers;


use App\SunPicture;
use League\Fractal\TransformerAbstract;


class SunpictureAllTransformer extends TransformerAbstract
{
    public function transform(SunPicture $sunPicture)
    {
        $avatarUrl = "http://yuejian.app/uploads/avatars/";
        return [
            
            'post_id' => $sunPicture['id'],
            'posts_content' => $sunPicture['posts_content'],
            'comments_count' => $sunPicture['comments_count'],
            'posts_pic' => $avatarUrl.$sunPicture['posts_pic'],
            'level'=>$sunPicture['level'],
            'user' => isset($sunPicture->user) ? $sunPicture->user:'Null',
        ];
    }
}